|
![](/i/fill.gif) |
Dave Blandston wrote:
> My original goal was to make a normal to use for cloth, but I couldn't get that
> to work and I had to settle for a texture. It would be great if this texture
> could be made into a normal though.
I redesigned this as a pigment by replacing the layered texture
with a pigment_map. Therefore, you can now define a pigment function
and use that as normal pattern. Nice texture BTW ;)
#local ClothScale = .5;
#local ThreadWidth = .2;
#local EdgeWidth = .08;
#declare P_Cloth = pigment
{
gradient x
color_map
{
[0 color Black]
[.1 color Black]
[.5 color White * 4]
[.9 color Black]
[1 color Black]
}
}
#declare P_Cloth = pigment
{
gradient y
pigment_map
{
[0 color Black]
[.5 - ThreadWidth / 2 - EdgeWidth color Black]
[.5 - ThreadWidth / 2 P_Cloth]
[.5 + ThreadWidth / 2 P_Cloth]
[.5 + ThreadWidth / 2 + EdgeWidth color Black]
[1 color Black]
}
}
#declare P_Cloth = pigment
{
average
pigment_map
{
[1 P_Cloth]
[1 P_Cloth translate <.5, .5, 0>]
[1 P_Cloth rotate 90 * z translate <.5, 0, 0>]
[1 P_Cloth rotate 90 * z translate <0, .5, 0>]
}
scale <ClothScale, ClothScale, 1>
}
#declare f_cloth = function {pigment {P_Cloth}}
#declare N_Cloth = normal {function {f_cloth(x,y,z).red}}
Post a reply to this message
|
![](/i/fill.gif) |